package cn.kgc.education.service.impl;

import cn.kgc.education.response.ResponseResult;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.kgc.education.entity.Student;
import cn.kgc.education.service.StudentService;
import cn.kgc.education.mapper.StudentMapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
* @author mengshun
* @description 针对表【student】的数据库操作Service实现
* @createDate 2024-09-10 16:04:50
*/
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService{


    //   如何通过持久层的查询  获取折线图数据
    @Override
    public ResponseResult lineData() {

       List<Map<String,Object>>  lineDats =  baseMapper.lineData();

        ResponseResult responseResult = new ResponseResult();
        responseResult.setData(lineDats);
        responseResult.setCode(0);

        return responseResult;
    }

    @Override
    public ResponseResult roseData() {

        List<Map<String,Object>> roseDats =   baseMapper.roseData();
        ResponseResult responseResult = new ResponseResult();
        responseResult.setData(roseDats);
        responseResult.setCode(0);
        return responseResult;
    }

    @Override
    public ResponseResult barData() {


       List<Map<String,Object>>  barData =   baseMapper.barData();

        ResponseResult responseResult = new ResponseResult();
        responseResult.setCode(0);
        responseResult.setData(barData);
        return responseResult;
    }
}




